package com.wechat.common;

import java.io.File;

import javax.swing.filechooser.FileSystemView;

import com.jfinal.weixin.sdk.api.ApiResult;
import com.jfinal.weixin.sdk.api.MediaApi;
import com.jfinal.weixin.sdk.api.MediaApi.MediaType;

public class WxUtils {

	public static ApiResult uploadImg(String wxid) {
		String path = FileSystemView.getFileSystemView().getHomeDirectory() + File.separator + "testQrcode";
        String fileName = "temp.jpg";
		ApiResult rs = MediaApi.uploadMedia(MediaType.IMAGE, QrCodeUtil.createQrCode("https://www.wisheso.com/wcode/user?wxid="+wxid, path, fileName));
		System.out.println(rs.getJson());
		return rs;
	}
	
}
